/*
 * @Author: xuesong
 * @Date: 2021-11-30 10:44:56
 * @LastEditTime: 2021-12-04 09:45:09
 * @LastEditors: xuesong
 * @Description: 
 * @FilePath: \BLE\projects\ble_peripheral\uart_ble\src\TM_Driver\tm1628A.h
 */

#ifndef __TM1628_DRIVER_H__
#define __TM1628_DRIVER_H__

#include "types.h"

#ifdef __cplusplus
extern "C"
{
#endif
//-------------------CMD---------------------------
#define     DISPLAY_MODE_CMD    (0x00<<6)
#define     DISPLAY_DATA_CMD    (0x01<<6)
#define     DISPLAY_CONTROL_CMD (0x02<<6)
#define     DISPLAY_ADDR_CMD    (0x03<<6)
//-------------------MODE OPTION-------------------
#define     DISPLAY_MODE_4C13   (0x00)
#define     DISPLAY_MODE_5C12   (0x01)
#define     DISPLAY_MODE_6C11   (0x02)
#define     DISPLAY_MODE_7C10   (0x03)
//-------------------DATA OPTION-------------------
#define     DISPLAY_DATA_WRITE  (0x00)
#define     DISPLAY_DATA_READ   (0x02)
#define     DISPLAY_DATA_ADDP   (0x00)
#define     DISPLAY_DATA_ADDS   (0x04)
#define     DISPLAY_DATA_TEST   (0x08)
//--------------------CONTROL OPTION----------------
#define     DISPLAY_CONTROL_PWM1_16  (0x00)
#define     DISPLAY_CONTROL_PWM2_16  (0x01)
#define     DISPLAY_CONTROL_PWM4_16  (0x02)
#define     DISPLAY_CONTROL_PWM10_16 (0x03)
#define     DISPLAY_CONTROL_PWM11_16  (0x04)
#define     DISPLAY_CONTROL_PWM12_16  (0x05)
#define     DISPLAY_CONTROL_PWM13_16  (0x06)
#define     DISPLAY_CONTROL_PWM14_16  (0x07)
#define     DISPLAY_CONTROL_ON        (0x08)
#define     DISPLAY_CONTROL_OFF       (0x00)
//--------------------------------------------------  
#define     Driver_DISPLAY_SIZE      7
//--------------------------------------------------
typedef uint16_t DisplayBufferType;
extern DisplayBufferType Driver_DisplayBuff[Driver_DISPLAY_SIZE];
//--------------------------------------------------
void Tm1628A_IO_Init(void);
void Tm1628A_IO_PowerDown(void);
void TM1628_Init(void);
void Data2TM1628(uint16 *dataBuff,uint8 len);
#ifdef __cplusplus
}
#endif

#endif

